﻿namespace Mvvm.Common
{
    public delegate bool? ShowDialogedResultHandel(string message, string caption, string okButtonStr,string cancelButtonStr);
    public class DialogResultModel
    {
        public event ShowDialogedResultHandel ShowDialogedResult;

        /// <summary>
        /// 显示消息
        /// </summary>
        /// <param name="message"></param>
        /// <param name="caption"></param>
        /// <param name="okButtonStr"></param>
        /// <param name="cancelButtonStr"></param>
        /// <returns></returns>
        public bool? ShowDialog(string message, string caption = "提示", string okButtonStr = "确定",string cancelButtonStr="取消")
        {
            if (ShowDialogedResult == null) return true;
            return ShowDialogedResult(message, caption, okButtonStr,cancelButtonStr);
        }
    }
}